package com.daqian.cloud.client.demo2.controller;

import com.daqian.cloud.client.demo2.feign.Demo1ServiceFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: daqian
 * @Date: 2019/4/22 21:14
 */
@RestController
@RequestMapping("demo2")
public class Demo2Controller {

    @Autowired
    private Demo1ServiceFeign demo1ServiceFeign;

    @GetMapping("getStr/{str}")
    public String getDemoStr(@PathVariable("str") String str) {
        return demo1ServiceFeign.getDemoStr(str);
    }

    @GetMapping("test")
    public String test() {
        return "test demo2";
    }
}
